import {createRouter,createWebHistory} from 'vue-router';

//导入组件
import loginVue from '@/views/Login.vue'
import LayoutVue from '@/views/Layout.vue'
import CompanyManageVue from '@/views/manage/CompanyManage.vue'
import SiteManageVue from '@/views/manage/SiteManage.vue'
import FeeDetailsVue from '@/views/manage/FeeDetails.vue'
import UserAvatarVue from '@/views/user/UserAvatar.vue'
import UserInfoVue from '@/views/user/UserInfo.vue'
import UserResetPasswordVue from '@/views/user/UserResetPassword.vue'

//定义路由关系
const routes = [
    {path:'/login',component: loginVue},
    {path:'/',component: LayoutVue,children:[
        {path:'/manage/companymanage', component:CompanyManageVue},
        {path:'/manage/sitemanage', component:SiteManageVue},
        {path:'/manage/feedetails', component:FeeDetailsVue},
        {path:'/user/avatar', component:UserAvatarVue},
        {path:'/user/info', component:UserInfoVue},
        {path:'/user/resetPassword', component:UserResetPasswordVue}
    ]}
]

//创建路由器
const router = createRouter({
    history:createWebHistory(),
    routes:routes
})

//导出路由
export default router